﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="submenu.ascx.cs" Inherits="control_client_submenu" %>
<div class="col-module ">                                 
    <div class="col-module_header_l"></div>
    <div class="col-module_header_r"></div>                                    									
	<h3><span>Danh mục</span> Sản phẩm</h3>                                                                                                    	
    <div class="col-module-content clearfix">                                                                
        <ul id="default_439" class="default_vert_accordion_mm level0">
            <asp:Repeater ID="rptDanhMucCha" runat="server" DataSourceID="SqlDataSourceDanhMucCha">
                <ItemTemplate>
                    <asp:Label ID="lbIdDanhMucCha" runat="server" Text='<%# Eval("Id") %>' Visible="false"> </asp:Label>                    
                    <li class="sm_normal">
                        <div class="default_vert_accordion_h haschilds">
                            <a class="icemenu_link" href='ListProducts.aspx?action=cate&danhmuc=<%# Eval("Id") %>'><span class="accArrow"></span><span class="title"><%#Eval("Ten") %></span><span class="icemenu_haschild"></span></a>
                        </div>
                        <ul id="default_439_642_lvl_1" class="default_vert_accordion_sm level1">
                            <asp:Repeater ID="rptDanhMucCon" runat="server" DataSourceID="SqlDataSourceDanhMucCon">
                                <ItemTemplate>
                                    <li class="sm_normal">
                                        <div class="default_vert_accordion_h"><a class="icemenu_link" href="ListProducts.aspx?action=sub&danhmuc=<%# Eval("Id") %>"><span class="title titlefix"><%#Eval("Ten") %></span><span class="icemenu_haschild"></span></a></div>
                                    </li>
                                </ItemTemplate>
                            </asp:Repeater>
                        </ul>
                            <asp:SqlDataSource ID="SqlDataSourceDanhMucCon" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                SelectCommand="Proc_DanhMucSanPham_SelectDanhMucCon" 
                                SelectCommandType="StoredProcedure">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="lbIdDanhMucCha" Name="DanhMucCha" PropertyName="Text" Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
            <asp:SqlDataSource ID="SqlDataSourceDanhMucCha" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="Proc_DanhMucSanPham_SelectDanhMucCha" 
                        SelectCommandType="StoredProcedure">                        
                    </asp:SqlDataSource>
	     </ul>
           
        <script type="text/javascript">
            window.addEvent('domready', function () {
                $$('#default_439 .sm_active').each(function (el) {
                    var c = $(el).getParent();
                    var h = $(c).getPrevious('div.default_vert_accordion_h');
                    $(h).addClass('oppened');
                    if (c) { c.style.height = 'auto'; c.style.visibility = 'visible'; c.d = 1; }
                    var testid = c.id;
                    while (testid != 'default_439') {
                        c = $(c).getParent('ul');
                        var h = $(c).getPrevious('div.default_vert_accordion_h');
                        if (h) {
                            $(h).addClass('oppened');
                            if (c) { c.style.height = 'auto'; c.style.visibility = 'visible'; c.d = 1; }
                        }
                        testid = c.id;
                    }
                });
            });
            var acc439lvl_0 = new IceMenu439.accordion.slider("acc439lvl_0");
            acc439lvl_0.init("default_439", "div", "ul", 1, -1);

            var acc439_642_lvl_1 = new IceMenu439.accordion.slider("acc439_642_lvl_1");
            acc439_642_lvl_1.init("default_439_642_lvl_1", "div", "ul", 1, -1);

            var acc439_770_lvl_1 = new IceMenu439.accordion.slider("acc439_770_lvl_1");
            acc439_770_lvl_1.init("default_439_770_lvl_1", "div", "ul", 1, -1);
		</script>
    </div>                                                                       	                              
	</div>